Cs 598csc: Approximation Algorithms 1 the Knapsack Problem 1.1 Problem Description 1.2 a Greedy Algorithm
نویسنده
چکیده
In the Knapsack problem we are given a knapsack capacity B, and set N of n items. Each item i has a given size si ≥ 0 and a profit pi ≥ 0. Given a subset of the items A ⊆ N , we define two functions, s(A) = ∑ i∈A si and p(A) = ∑ i∈A pi, representing the total size and profit of the group of items respectively. The goal is to choose a subset of the items, A, such that s(A) ≤ B and p(A) is maximized. We will assume every item has size at most B. It is not difficult to see that if all the profits are 1, the natural greedy algorithm of sorting the items by size and then taking the smallest items will give an optimal solution. Assuming the profits and sizes are integral, we can still find an optimal solution to the problem relatively quickly using dynamic programming in either O(nB) or O(nP ) time, where P = ∑n i=1 pi. Finding the details of these algorithms was given as an exercise in the practice homework. While these algorithms appear to run in polynomial time, it should be noted that B and P can be exponential in the size of the input assuming the numbers in the input are not written in unary. We call these pseudo-polynomial time algorithms as their running times are polynomial only when numbers in the input are given in unary.
منابع مشابه
A Novel Genetic Algorithm using Helper Objectives for the 0-1 Knapsack Problem
The 0-1 knapsack problem is a well-known combinatorial optimisation problem. Approximation algorithms have been designed for solving it and they return provably good solutions within polynomial time. On the other hand, genetic algorithms are well suited for solving the knapsack problem and they find reasonably good solutions quickly. A naturally arising question is whether genetic algorithms ar...
متن کاملDistributed Approximation Algorithms for the Multiple Knapsack Problem
We consider the distributed version of the Multiple Knapsack Problem (MKP), wherem items are to be distributed amongst n processors, each with a knapsack. We propose different distributed approximation algorithms with a tradeoff between time and message complexities. The algorithms are based on the greedy approach of assigning the best item to the knapsack with the largest capacity. These algor...
متن کاملCs 598csc: Approximation Algorithms 1 Multiprocessor Scheduling with Precedence Constraints 1.1 Problem Description
In the Multiprocessor Scheduling with Precedence Constraints, we are given n-jobs denoted by {J1, J2, · · · , Jn}, the associated processing time pi, i = 1, · · · , n and m identical machines to which jobs are needed to be assigned. In addition, jobs have precedence constraints between them, and we use notation Jj ≺ Ji to imply that Ji cannot be done before completing Jj (the smaller runs earli...
متن کاملAn employee transporting problem
An employee transporting problem is described and a set partitioning model is developed. An investigation of the model leads to a knapsack problem as a surrogate problem. Finding a partition corresponding to the knapsack problem provides a solution to the problem. An exact algorithm is proposed to obtain a partition (subset-vehicle combination) corresponding to the knapsack solution. It require...
متن کاملApproximation Algorithms for the Multiple Knapsack Problem with Assignment Restrictions
Motivated by a real world application, we study the multiple knapsack problem with assignment restrictions (MKAR). We are given a set of items, each with a positive real weight, and a set of knapsacks, each with a positive real capacity. In addition, for each item a set of knapsacks that can hold that item is specified. In a feasible assignment of items to knapsacks, each item is assigned to at...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2009